<div ng-form name="form" novalidate="novalidate">
    <div class="help-doc-item help-doc" ng-show="toggle_help">
        <p>大厅接待使用此表单录入流量（接待）信息</p>
        <p>系统使用此表单提交的流量来生成各类销售、绩效报表，请务必<strong>认真填写</strong></p>
        <p>用户可以任意保存和修改表单，但是提交后<strong>无法删除</strong>，请谨慎提交</p>
        <p>试乘试驾和订单暂时<strong>无法保存</strong>，我们会尽快添加保存功能</p>
        <strong class="alert-danger">该表单会在每日晚上24点进行清理，所有无法正常提交的表单都会被清理（删除）</strong>
    </div>

    <div class="overlay-content">
        <div class="overlay-column overlay-column-3">
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    表单生成的日期，不能修改
                </p>
                <span class="overlay-name">日期</span>
                <input type="text" value="{{reception.date | date:'yyyy-MM-dd'}}" disabled>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    生成该流量的当前门店，无法修改
                </p>
                <span class="overlay-name">销售门店</span>
                <input type="text"
                       ng-model="reception.sales_shop_name"
                       disabled>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户到店时间 或者 <strong>邀约到店</strong>的时间
                </p>
                <span class="overlay-name">到店时间</span>
                <datetimepicker ng-model="reception.arrive_time"
                                format="hh:ii"
                                start-view="1"
                                max-view="1"
                                title="false"
                                ng-disabled = "mode == 'test_drive'"
                        ></datetimepicker>
            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户离店时间
                    <br/>
                    在接触性质为 首次进入、再次进入、邀约到店时，离店时间必须填写
                </p>

                <span class="overlay-name">离店时间</span>
                <datetimepicker ng-model="reception.exit_time"
                                name = "exit_time"
                                format="hh:ii"
                                start-view="1"
                                max-view="1"
                                title="false"
                                start-date="reception.arrive_time"
                                ng-required = "(reception.entrance_type == '1' || reception.entrance_type == '2' || reception.entrance_type == '6') || mode !== 'test_drive'"
                                ng-disabled = "mode == 'test_drive'"
                        ></datetimepicker>

                <p ng-show="form.exit_time.$invalid" class="overlay-item-bottom">
                    在接触性质为 首次进入、再次进入、邀约到店时，离店时间必须填写
                </p>

            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    为此流量分配销售顾问,能选择的范围取决于当前用户的权限
                </p>
                <span class="overlay-name">销售顾问 </span>
                <salesman-picker
                        name="salesman"
                        ng-required="mode !== 'test_drive'"
                        ng-model="reception.salesman"
                        ng-disabled = "mode == 'test_drive'">
                        </salesman-picker>

                <p ng-show="form.salesman.$invalid" class="overlay-item-bottom">
                    销售顾问必填
                </p>
            </div>

            <div class="overlay-item">
                <span class="overlay-name">当前顾问</span>
                <input type="text"
                       name="owner_id"
                       ng-model="reception.owner_id"
                       ng-disabled = "true">
            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help" >
                    务必核对潜客接触方式，该条目对于潜客分析很关键，特别是当潜客是再次进入时、谨慎选择
                </p>
                <span class="overlay-name">接触方式</span>
                <select ng-model="reception.meeting_type"
                        name="meeting_type"
                        ng-change="meeting_type_change()"
                        ng-required = "mode !== 'test_drive'" ng-disabled = "mode == 'test_drive'">
                    <option value="showroom">展厅</option>
                    <option value="dcc">DCC</option>
                </select>
                <p ng-show="form.meeting_type.$invalid" class="overlay-item-bottom ">
                    接触方式必填
                </p>
            </div>
            <div class="overlay-item" ng-show="reception.meeting_type=='showroom'">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必核对潜客接触性质，谨慎选择
                </p>
                <span class="overlay-name">接触性质</span>
                <select ng-model="reception.entrance_type"
                        name="entrance_type"
                        ng-required="reception.meeting_type=='showroom' && mode !== 'test_drive'" ng-disabled = "mode == 'test_drive'">
                    <option value="1">首次进入</option>
                    <option value="2">再次进入</option>
                    <option value="4">订单后</option>
                    <option value="3">非购车用户</option>
                </select>
                <p ng-show="form.entrance_type.$invalid" class="overlay-item-bottom ">
                    接触性质必填
                </p>
            </div>
            <div class="overlay-item" ng-show="reception.meeting_type=='dcc'">
                <span class="overlay-name">接触性质</span>
                <select ng-model="reception.entrance_type" ng-required="reception.meeting_type=='dcc' && mode !== 'test_drive'" name="entrance_type_dcc" ng-disabled = "mode == 'test_drive'">
                    <option value="5">在途</option>
                    <option value="6">邀约到店</option>
                    <option value="2">再次进入</option>
                    <option value="4">订单后</option>
                </select>
                <p ng-show="form.entrance_type_dcc.$invalid" class="overlay-item-bottom ">
                    接触性质必填
                </p>
            </div>
        </div>
        <div class="overlay-column overlay-column-3">
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户的联系电话，潜客的唯一标记ID，只有下列情况可以不填:
                    <br> * 首次进入
                    <br> * 非购车
                    <br> ，其他情况必须是<i>11位合法的手机号码</i>
                    <br>
                    如果此潜客系统内登记过，系统会自动匹配
                </p>
                <span class="overlay-name">联系电话</span>
                <input type="text" ng-model="reception.phone"
                       name = "phone"
                       ng-disabled = "mode == 'test_drive'"
                       ng-blur="reception.phone_blur(reception,reception.phone)"
                       ng-pattern = "/^[0-9]{11}$/"
                       ng-required = "mode !== 'test_drive' && reception.entrance_type != '3' && reception.entrance_type != '1'">
                <p ng-show = "form.phone.$invalid" class="overlay-item-bottom">
                    客户的联系电话，潜客的唯一标记ID，只有下列情况可以不填:
                    <br> * 首次进入
                    <br> * 非购车
                    <br> ，其他情况必须是<i>11位合法的手机号码</i>
                </p>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户的姓名，以流量实际拿到的为准，同一个潜客（相同登记号码视为同一个潜客）的姓名以最近一次录入的流量上的姓名为准
                </p>
                <span class="overlay-name">姓名</span>
                <input type="text" ng-model="reception.name" ng-disabled = "mode == 'test_drive'">
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户的性别，无法确认则留空：）
                </p>
                <span class="overlay-name">性别</span>
                <select ng-model="reception.sex" ng-disabled = "mode == 'test_drive'">
                    <option value="1">男</option>
                    <option value="2">女</option>
                </select>
            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    无法确认留空、不要随意填写
                </p>
                <span class="overlay-name">兴趣爱好</span>
                <input type="text" ng-model="reception.habit" ng-disabled = "mode == 'test_drive'">
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必确认潜客区域
                </p>
                <span class="overlay-name">客户区域</span>
                <select ng-model="reception.region" ng-disabled = "mode == 'test_drive'">
                    <option value="新区">新区</option>
                    <option value="姑苏">姑苏</option>
                    <option value="园区">园区</option>
                    <option value="相城">相城</option>
                    <option value="吴中">吴中</option>
                    <option value="吴江">吴江</option>
                    <option value="常熟">常熟</option>
                    <option value="外区">外区</option>
                </select>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必确认潜客来源
                </p>
                <span class="overlay-name">来源</span>

                <select ng-model="reception.source"
                        ng-disabled = " mode == 'test_drive'">
                    <option value="1">路过</option>
                    <option value="2">网络</option>
                    <option value="3">广电</option>
                    <option value="4">基盘</option>
                    <option value="5">活动</option>
                    <option value="6">亲朋介绍</option>
                    <option value="7">全员销售</option>
                </select>

                <input type="text" placeholder="客户名"
                       name="jipan_customer_name"
                       ng-model="reception.jipan_customer_name"
                       ng-show = "reception.source == 4"
                       ng-required="reception.source == 4 "
                       ng-disabled = "mode == 'test_drive'">

                <input type="text" placeholder="客户联系方式"
                       name="jipan_customer_phone"
                       ng-show = "reception.source == 4"
                       ng-model="reception.jipan_customer_phone"
                       ng-required="reception.source == 4 "
                       ng-disabled = "mode == 'test_drive'">

                <input type="text" placeholder="客户车牌"
                       name="jipan_customer_license_plate"
                       ng-show = "reception.source == 4"
                       ng-model="reception.jipan_customer_license_plate"
                       ng-required="reception.source == 4 "
                       ng-disabled = " mode == 'test_drive'">

                <input type="text" placeholder="客户车型"
                       name="jipan_vehicle_model"
                       ng-show = "reception.source == 4"
                       ng-model="reception.jipan_vehicle_model"
                       ng-required="reception.source == 4 "
                       ng-disabled = " mode == 'test_drive'">
                <!-- <vm-selector
                    placeholder="客户车型"
                       ng-show = "reception.source == 4"
                       vehicle-model="reception.jipan_vehicle_model_data"
                       ng-required="reception.source == 4 "
                       ng-disabled = " mode == 'test_drive'">        
                </vm-selector> -->

                <!-- <input type="text" placeholder="门店"
                       name="recommend_shop"
                       ng-show="reception.source == 7"
                       ng-model="reception.recommend_shop"
                       ng-required="reception.source == 7"
                       ng-disabled = "mode == 'test_drive'"> -->
                <shop-picker class="from-control"
                        mode ="'normal'"
                       placeholder="门店" 
                       ng-show="reception.source == 7"
                       shop="reception.recommend_shop_data"
                       ng-required="reception.source == 7"
                       ng-disabled = "mode == 'test_drive'"></shop-picker>

                <input type="text" placeholder="部门"
                       name="recommend_dept"
                       ng-show="reception.source == 7"
                       ng-model="reception.recommend_dept"
                       ng-required="reception.source == 7 "
                       ng-disabled = "mode == 'test_drive'">

                <input type="text" placeholder="姓名"
                       name="recommend_name"
                       ng-show="reception.source == 7"
                       ng-model="reception.recommend_name"
                       ng-required="reception.source == 7 "
                       ng-disabled = " mode == 'test_drive'">

                <input type="text" placeholder="联系方式"
                       name="recommend_phone"
                       ng-show="reception.source == 7"
                       ng-model="reception.recommend_phone"
                       ng-required="reception.source == 7 "
                       ng-disabled = " mode == 'test_drive'">
            </div>


        </div>

        <div class="overlay-column overlay-column-3">
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help" >
                    务必核对潜客购买性质，该条目对于潜客分析很关键
                </p>
                <span class="overlay-name">购买性质</span>
                <select ng-model="reception.replacement_assessment"
                        ng-required = "mode !== 'test_drive'"
                        name = "replacement_assessment" ng-disabled = "mode == 'test_drive'">

                    <option value="0">首购</option>
                    <option value="1">增购</option>
                    <option value="2">换购</option>
                    <!-- <option value="3">评估</option> -->
                </select>
                <p ng-show="form.replacement_assessment.$invalid" class="overlay-item-bottom">
                    购买性质必填
                </p>
            </div>

            <div class="overlay-item" ng-show = "reception.replacement_assessment == 2 || reception.replacement_assessment == 3">
                <p class="overlay-item-top help-doc" ng-show="toggle_help" >
                    当购买性质为换购和评估时,必填
                </p>
                <span class="overlay-name">评估师</span>
                <evaluator-picker ng-required="reception.replacement_assessment == 2 || reception.replacement_assessment == 3 "
                                  name="appraiser"
                                  ng-model="reception.appraiser"
                                  ng-disabled = "mode == 'test_drive'"></evaluator-picker>
                <p ng-show="form.appraiser.$invalid"
                   class="overlay-item-bottom">
                    评估师必填
                </p>
            </div>

            <div class="overlay-item"
                 ng-show="reception.entrance_type != 5"
                 style="{{mode== 'test_drive' ? 'border: red 1px solid': '' }}">

                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必确认试乘试驾
                </p>
                <span class="overlay-name">试乘试驾</span>
                <select ng-model="reception.is_test_drive" ng-disabled = "mode == 'test_drive'">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
                <div ng-show = "mode == 'test_drive'" >
                    <vehicle-demo-picker
                            ng-model="reception.vehicle_demo" ></vehicle-demo-picker>
                    <input type="text" placeholder="驾驶员" ng-model="reception.test_driver" >

                    <datetimepicker placeholder="开始时间"
                                    format="hh:ii"
                                    start-view="1"
                                    start-date="reception.arrive_time"
                                    end-date="reception.test_end_time"
                                    ng-model="reception.test_start_time"></datetimepicker>

                    <datetimepicker placeholder="结束时间"
                                    format="hh:ii"
                                    start-view="1"
                                    start-date="reception.test_start_time"
                                    ng-model="reception.test_end_time"></datetimepicker>

                    <input type="number" placeholder="起始公里数" ng-model="reception.vehicle_demo.mileage" disabled>
                    <input type="number" step="0.1" min="0" placeholder="结束公里数"
                           ng-model="reception.mileage_after">
                </div>
            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户级别选择，当前潜客等级是O级时可以<strong>下单</strong>
                </p>
                <span class="overlay-name">客户级别</span>
                <select ng-model="reception.customer_level" ng-disabled = "mode == 'test_drive'">
                    <option value=""></option>
                    <option value="O"
                            ng-show="reception.entrance_type != 5 && reception.entrance_type != 4">O (订单)</option>
                    <option value="H">H (一周内）</option>
                    <option value="A">A (二周内）</option>
                    <option value="B">B (一个月）</option>
                    <option value="C">C (二个月）</option>
                    <option value="N">N (首次接触）</option>
                </select>
            </div>
            <div class="overlay-item" ng-if ="!validate_role('V_VISIT_CREATE_VEHICLE_MODEL_FREE_EDIT')">
                <span class="overlay-name">意向车型</span>
                <vm-selector vehicle-model="reception.vehicle"
                             ng-disabled = "mode == 'test_drive'"></vm-selector>
            </div>

            <div class="overlay-item" ng-if ="validate_role('V_VISIT_CREATE_VEHICLE_MODEL_FREE_EDIT')">
                <span class="overlay-name">意向车型</span>
                <vm-input ng-model="reception.vehicle"
                          ng-disabled = "mode == 'test_drive'"></vm-input>
            </div>
            <!-- <div class="overlay-item" >
                <span class="overlay-name">意向车型</span>
                <vm-selector vehicle-model="vehicle"
                             level="1"
                        ></vm-selector>
            </div> -->
        </div>
        <div class=" overlay-item help-doc" ng-show="toggle_help"></div>
    </div>
</div>